package sortcomparator;

import jiekoudeshiyongshili.One;

import java.util.Comparator;

public class Second implements Comparator<One> {
    @Override
    public int compare(One o1, One o2) {

        return o2.name.compareTo(o1.name);
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);//俩个变量是否相同
    }

    @Override
    public Comparator<One> reversed() {
        //会返回一个和compare相反排序的方法
        return Comparator.super.reversed();
    }

    @Override
    public Comparator<One> thenComparing(Comparator<? super One> other) {
        return Comparator.super.thenComparing(other);
    }
}
